package org.boot.event;

import org.springframework.boot.availability.AvailabilityChangeEvent;
import org.springframework.boot.availability.ReadinessState;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class MyReadinessStateExporter {

    @EventListener
    public void onStateChange(AvailabilityChangeEvent<ReadinessState> event) {
        /*switch (event.getState()) {
            case REFUSING_TRAFFIC -> System.out.println("REFUSING_TRAFFIC");
            case ACCEPTING_TRAFFIC -> System.out.println("ACCEPTING_TRAFFIC");
            default -> System.out.println("default");
        }*/
    }

}